#include <stdio.h>

#define SET_BIT(x,y)        ((x) |= (y))
#define CLEAR_BIT(x,y)      ((x) &= ~(y))
#define CHKBIT_SET(x,y)     (((x)&(y)) == (y))
#define CHKBIT_CLR(x,y)     (((x)&(y)) == 0)


int main()
{
	int temp = 0xff;

	printf("temp = 0x%02x\n", CLEAR_BIT(temp, 0xff));
	printf("temp = 0x%02x\n", SET_BIT(temp, 0xff));

	return 0;
}


#if 0
/*
 * intel
 */


/*
 * arm v8
 */
int main()
{
  400590:	a9be7bfd 	stp	x29, x30, [sp, #-32]!
  400594:	910003fd 	mov	x29, sp
	int temp = 0xff;
  400598:	52801fe0 	mov	w0, #0xff                  	// #255
  40059c:	b9001fa0 	str	w0, [x29, #28]

	printf("temp = 0x%02x\n", CLEAR_BIT(temp, 0xff));
  4005a0:	b9401fa0 	ldr	w0, [x29, #28]
  4005a4:	12185c00 	and	w0, w0, #0xffffff00
  4005a8:	b9001fa0 	str	w0, [x29, #28]
  4005ac:	90000000 	adrp	x0, 400000 <_init-0x3c8>
  4005b0:	911a0000 	add	x0, x0, #0x680
  4005b4:	b9401fa1 	ldr	w1, [x29, #28]
  4005b8:	97ffff9e 	bl	400430 <printf@plt>
	printf("temp = 0x%02x\n", SET_BIT(temp, 0xff));
  4005bc:	b9401fa0 	ldr	w0, [x29, #28]
  4005c0:	32001c00 	orr	w0, w0, #0xff
  4005c4:	b9001fa0 	str	w0, [x29, #28]
  4005c8:	90000000 	adrp	x0, 400000 <_init-0x3c8>
  4005cc:	911a0000 	add	x0, x0, #0x680
  4005d0:	b9401fa1 	ldr	w1, [x29, #28]
  4005d4:	97ffff97 	bl	400430 <printf@plt>

	return 0;
  4005d8:	52800000 	mov	w0, #0x0                   	// #0
}

/*
 * arm v7
 */


#endif

